Page({
  //获取设备信息
  getSystem() {
    //异步编程
    wx.getSystemInfo({
      success: (result) => {
        // console.log(result)

      },
    })
    // console.log(result)
    //同步编程
    let result = wx.getSystemInfoSync()
    console.log(result)
  },
  //提示信息
  showToast() {
    wx.showToast({
      title: '成功提交',
      icon: "none",
      mask: true,
      duration: 5000
    })
  },
  //模拟对话框
  showModal() {
    wx.showModal({
      title: "温馨提示",
      content: "您确定要删除吗？",
      success: res => {
        if (res.confirm) {
          //删除数据库中的内容
        }
      }

    })
  },
  //加载框
  showLoading() {
    wx.showLoading({
      title: '正在加载',
    })
  },
  //隐藏加载框
  hideLoading() {
    wx.hideLoading()
  },
  //弹出底部菜单
  showSheet() {
    wx.showActionSheet({
      alertText: "这是标题",
      itemList: ["北京", "上海", "广州", "深圳"],
      success: res => {
        console.log(res)
      }
    })
  },
  showLoading() {
    wx.showNavigationBarLoading()
  },
  hideLoading() {
    wx.hideNavigationBarLoading()
  },
  //显示红点
  showDot() {
    wx.showTabBarRedDot({
      index: 0
    })
  },
  //隐藏红点
  hideDot() {
    wx.hideTabBarRedDot({
      index: 0,
    })
  },
  //隐藏tabbar
  hideTabbar() {
    wx.hideTabBar({
      animation: true,
    })
  },
  //显示tabbar
  showTabbar() {
    wx.showTabBar({
      animation: true,
    })
  },
  //动态设置 tabBar 某一项的内容
  changeTabbar() {
    wx.setTabBarItem({
      index: 0,
      text: "index",
      iconPath: "/images/member.png",
      selectedIconPath: "/images/member-selected.png"
    })
  },
  //存储缓存
  handleSet() {
    wx.setStorage({
      data: ["五方桥", "三元桥", "三里屯"],
      key: 'address',
    })

  },
  //删除某一个key
  handleRemove() {
    wx.removeStorageSync('address')
  },
  //清除所有key
  handleClear() {
    wx.clearStorageSync()
  },
  //读取缓存
  handleGet() {
    let result = wx.getStorageSync('address')
    console.log(result)
  },
  //读取缓存的描述信息
  handleGetInfo() {
    let result = wx.getStorageInfoSync()
    console.log(result)
  }

})